Integrand size = 17, antiderivative size = 60 \[ \int \frac {\tanh ^2(x)}{\sqrt {a+b \tanh ^2(x)}} \, dx=-\frac {\text {arctanh}\left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a+b \tanh ^2(x)}}\right )}{\sqrt {b}}+\frac {\text {arctanh}\left (\frac {\sqrt {a+b} \tanh (x)}{\sqrt {a+b \tanh ^2(x)}}\right )}{\sqrt {a+b}} \]
-arctanh(b^(1/2)*tanh(x)/(a+b*tanh(x)^2)^(1/2))/b^(1/2)+arctanh((a+b)^(1/2 )*tanh(x)/(a+b*tanh(x)^2)^(1/2))/(a+b)^(1/2)
Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.
Time = 0.45 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.68 \[ \int \frac {\tanh ^2(x)}{\sqrt {a+b \tanh ^2(x)}} \, dx=-\frac {a \coth (x) \operatorname {EllipticPi}\left (\frac {b}{a+b},\arcsin \left (\frac {\sqrt {\frac {(a-b+(a+b) \cosh (2 x)) \text {csch}^2(x)}{b}}}{\sqrt {2}}\right ),1\right ) \sqrt {(a-b+(a+b) \cosh (2 x)) \text {sech}^2(x)}}{b (a+b) \sqrt {\frac {(a-b+(a+b) \cosh (2 x)) \text {csch}^2(x)}{b}}} \]
-((a*Coth[x]*EllipticPi[b/(a + b), ArcSin[Sqrt[((a - b + (a + b)*Cosh[2*x] )*Csch[x]^2)/b]/Sqrt[2]], 1]*Sqrt[(a - b + (a + b)*Cosh[2*x])*Sech[x]^2])/ (b*(a + b)*Sqrt[((a - b + (a + b)*Cosh[2*x])*Csch[x]^2)/b]))
Time = 0.29 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.529, Rules used = {3042, 25, 4153, 25, 385, 224, 219, 291, 219}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\tanh ^2(x)}{\sqrt {a+b \tanh ^2(x)}} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int -\frac {\tan (i x)^2}{\sqrt {a-b \tan (i x)^2}}dx\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\int \frac {\tan (i x)^2}{\sqrt {a-b \tan (i x)^2}}dx\) |
\(\Big \downarrow \) 4153 |
\(\displaystyle -\int -\frac {\tanh ^2(x)}{\left (1-\tanh ^2(x)\right ) \sqrt {b \tanh ^2(x)+a}}d\tanh (x)\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \int \frac {\tanh ^2(x)}{\left (1-\tanh ^2(x)\right ) \sqrt {a+b \tanh ^2(x)}}d\tanh (x)\) |
\(\Big \downarrow \) 385 |
\(\displaystyle \int \frac {1}{\left (1-\tanh ^2(x)\right ) \sqrt {b \tanh ^2(x)+a}}d\tanh (x)-\int \frac {1}{\sqrt {b \tanh ^2(x)+a}}d\tanh (x)\) |
\(\Big \downarrow \) 224 |
\(\displaystyle \int \frac {1}{\left (1-\tanh ^2(x)\right ) \sqrt {b \tanh ^2(x)+a}}d\tanh (x)-\int \frac {1}{1-\frac {b \tanh ^2(x)}{b \tanh ^2(x)+a}}d\frac {\tanh (x)}{\sqrt {b \tanh ^2(x)+a}}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \int \frac {1}{\left (1-\tanh ^2(x)\right ) \sqrt {b \tanh ^2(x)+a}}d\tanh (x)-\frac {\text {arctanh}\left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a+b \tanh ^2(x)}}\right )}{\sqrt {b}}\) |
\(\Big \downarrow \) 291 |
\(\displaystyle \int \frac {1}{1-\frac {(a+b) \tanh ^2(x)}{b \tanh ^2(x)+a}}d\frac {\tanh (x)}{\sqrt {b \tanh ^2(x)+a}}-\frac {\text {arctanh}\left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a+b \tanh ^2(x)}}\right )}{\sqrt {b}}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {\text {arctanh}\left (\frac {\sqrt {a+b} \tanh (x)}{\sqrt {a+b \tanh ^2(x)}}\right )}{\sqrt {a+b}}-\frac {\text {arctanh}\left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a+b \tanh ^2(x)}}\right )}{\sqrt {b}}\) |
-(ArcTanh[(Sqrt[b]*Tanh[x])/Sqrt[a + b*Tanh[x]^2]]/Sqrt[b]) + ArcTanh[(Sqr t[a + b]*Tanh[x])/Sqrt[a + b*Tanh[x]^2]]/Sqrt[a + b]
3.3.32.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a, b}, x] && !GtQ[a, 0]
Int[1/(Sqrt[(a_) + (b_.)*(x_)^2]*((c_) + (d_.)*(x_)^2)), x_Symbol] :> Subst [Int[1/(c - (b*c - a*d)*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]
Int[(((e_.)*(x_))^(m_)*((c_) + (d_.)*(x_)^2)^(q_.))/((a_) + (b_.)*(x_)^2), x_Symbol] :> Simp[e^2/b Int[(e*x)^(m - 2)*(c + d*x^2)^q, x], x] - Simp[a* (e^2/b) Int[(e*x)^(m - 2)*((c + d*x^2)^q/(a + b*x^2)), x], x] /; FreeQ[{a , b, c, d, e, m, q}, x] && NeQ[b*c - a*d, 0] && LeQ[2, m, 3] && IntBinomial Q[a, b, c, d, e, m, 2, -1, q, x]
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f) Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio nalQ[n]))
Leaf count of result is larger than twice the leaf count of optimal. \(136\) vs. \(2(48)=96\).
Time = 0.10 (sec) , antiderivative size = 137, normalized size of antiderivative = 2.28
method | result | size |
derivativedivides | \(-\frac {\ln \left (\sqrt {b}\, \tanh \left (x \right )+\sqrt {a +b \tanh \left (x \right )^{2}}\right )}{\sqrt {b}}-\frac {\ln \left (\frac {2 a +2 b -2 b \left (1+\tanh \left (x \right )\right )+2 \sqrt {a +b}\, \sqrt {b \left (1+\tanh \left (x \right )\right )^{2}-2 b \left (1+\tanh \left (x \right )\right )+a +b}}{1+\tanh \left (x \right )}\right )}{2 \sqrt {a +b}}+\frac {\ln \left (\frac {2 a +2 b +2 b \left (\tanh \left (x \right )-1\right )+2 \sqrt {a +b}\, \sqrt {b \left (\tanh \left (x \right )-1\right )^{2}+2 b \left (\tanh \left (x \right )-1\right )+a +b}}{\tanh \left (x \right )-1}\right )}{2 \sqrt {a +b}}\) | \(137\) |
default | \(-\frac {\ln \left (\sqrt {b}\, \tanh \left (x \right )+\sqrt {a +b \tanh \left (x \right )^{2}}\right )}{\sqrt {b}}-\frac {\ln \left (\frac {2 a +2 b -2 b \left (1+\tanh \left (x \right )\right )+2 \sqrt {a +b}\, \sqrt {b \left (1+\tanh \left (x \right )\right )^{2}-2 b \left (1+\tanh \left (x \right )\right )+a +b}}{1+\tanh \left (x \right )}\right )}{2 \sqrt {a +b}}+\frac {\ln \left (\frac {2 a +2 b +2 b \left (\tanh \left (x \right )-1\right )+2 \sqrt {a +b}\, \sqrt {b \left (\tanh \left (x \right )-1\right )^{2}+2 b \left (\tanh \left (x \right )-1\right )+a +b}}{\tanh \left (x \right )-1}\right )}{2 \sqrt {a +b}}\) | \(137\) |
-ln(b^(1/2)*tanh(x)+(a+b*tanh(x)^2)^(1/2))/b^(1/2)-1/2/(a+b)^(1/2)*ln((2*a +2*b-2*b*(1+tanh(x))+2*(a+b)^(1/2)*(b*(1+tanh(x))^2-2*b*(1+tanh(x))+a+b)^( 1/2))/(1+tanh(x)))+1/2/(a+b)^(1/2)*ln((2*a+2*b+2*b*(tanh(x)-1)+2*(a+b)^(1/ 2)*(b*(tanh(x)-1)^2+2*b*(tanh(x)-1)+a+b)^(1/2))/(tanh(x)-1))
Leaf count of result is larger than twice the leaf count of optimal. 496 vs. \(2 (48) = 96\).
Time = 0.44 (sec) , antiderivative size = 3361, normalized size of antiderivative = 56.02 \[ \int \frac {\tanh ^2(x)}{\sqrt {a+b \tanh ^2(x)}} \, dx=\text {Too large to display} \]
[1/4*(sqrt(a + b)*b*log(-((a*b^2 + b^3)*cosh(x)^8 + 8*(a*b^2 + b^3)*cosh(x )*sinh(x)^7 + (a*b^2 + b^3)*sinh(x)^8 - 2*(a*b^2 + 2*b^3)*cosh(x)^6 - 2*(a *b^2 + 2*b^3 - 14*(a*b^2 + b^3)*cosh(x)^2)*sinh(x)^6 + 4*(14*(a*b^2 + b^3) *cosh(x)^3 - 3*(a*b^2 + 2*b^3)*cosh(x))*sinh(x)^5 + (a^3 - a^2*b + 4*a*b^2 + 6*b^3)*cosh(x)^4 + (70*(a*b^2 + b^3)*cosh(x)^4 + a^3 - a^2*b + 4*a*b^2 + 6*b^3 - 30*(a*b^2 + 2*b^3)*cosh(x)^2)*sinh(x)^4 + 4*(14*(a*b^2 + b^3)*co sh(x)^5 - 10*(a*b^2 + 2*b^3)*cosh(x)^3 + (a^3 - a^2*b + 4*a*b^2 + 6*b^3)*c osh(x))*sinh(x)^3 + a^3 + 3*a^2*b + 3*a*b^2 + b^3 + 2*(a^3 - 3*a*b^2 - 2*b ^3)*cosh(x)^2 + 2*(14*(a*b^2 + b^3)*cosh(x)^6 - 15*(a*b^2 + 2*b^3)*cosh(x) ^4 + a^3 - 3*a*b^2 - 2*b^3 + 3*(a^3 - a^2*b + 4*a*b^2 + 6*b^3)*cosh(x)^2)* sinh(x)^2 + sqrt(2)*(b^2*cosh(x)^6 + 6*b^2*cosh(x)*sinh(x)^5 + b^2*sinh(x) ^6 - 3*b^2*cosh(x)^4 + 3*(5*b^2*cosh(x)^2 - b^2)*sinh(x)^4 + 4*(5*b^2*cosh (x)^3 - 3*b^2*cosh(x))*sinh(x)^3 - (a^2 - 2*a*b - 3*b^2)*cosh(x)^2 + (15*b ^2*cosh(x)^4 - 18*b^2*cosh(x)^2 - a^2 + 2*a*b + 3*b^2)*sinh(x)^2 - a^2 - 2 *a*b - b^2 + 2*(3*b^2*cosh(x)^5 - 6*b^2*cosh(x)^3 - (a^2 - 2*a*b - 3*b^2)* cosh(x))*sinh(x))*sqrt(a + b)*sqrt(((a + b)*cosh(x)^2 + (a + b)*sinh(x)^2 + a - b)/(cosh(x)^2 - 2*cosh(x)*sinh(x) + sinh(x)^2)) + 4*(2*(a*b^2 + b^3) *cosh(x)^7 - 3*(a*b^2 + 2*b^3)*cosh(x)^5 + (a^3 - a^2*b + 4*a*b^2 + 6*b^3) *cosh(x)^3 + (a^3 - 3*a*b^2 - 2*b^3)*cosh(x))*sinh(x))/(cosh(x)^6 + 6*cosh (x)^5*sinh(x) + 15*cosh(x)^4*sinh(x)^2 + 20*cosh(x)^3*sinh(x)^3 + 15*co...
\[ \int \frac {\tanh ^2(x)}{\sqrt {a+b \tanh ^2(x)}} \, dx=\int \frac {\tanh ^{2}{\left (x \right )}}{\sqrt {a + b \tanh ^{2}{\left (x \right )}}}\, dx \]
\[ \int \frac {\tanh ^2(x)}{\sqrt {a+b \tanh ^2(x)}} \, dx=\int { \frac {\tanh \left (x\right )^{2}}{\sqrt {b \tanh \left (x\right )^{2} + a}} \,d x } \]
Leaf count of result is larger than twice the leaf count of optimal. 252 vs. \(2 (48) = 96\).
Time = 0.52 (sec) , antiderivative size = 252, normalized size of antiderivative = 4.20 \[ \int \frac {\tanh ^2(x)}{\sqrt {a+b \tanh ^2(x)}} \, dx=-\frac {2 \, \arctan \left (-\frac {\sqrt {a + b} e^{\left (2 \, x\right )} - \sqrt {a e^{\left (4 \, x\right )} + b e^{\left (4 \, x\right )} + 2 \, a e^{\left (2 \, x\right )} - 2 \, b e^{\left (2 \, x\right )} + a + b} + \sqrt {a + b}}{2 \, \sqrt {-b}}\right )}{\sqrt {-b}} - \frac {\log \left ({\left | -{\left (\sqrt {a + b} e^{\left (2 \, x\right )} - \sqrt {a e^{\left (4 \, x\right )} + b e^{\left (4 \, x\right )} + 2 \, a e^{\left (2 \, x\right )} - 2 \, b e^{\left (2 \, x\right )} + a + b}\right )} {\left (a + b\right )} - \sqrt {a + b} {\left (a - b\right )} \right |}\right )}{2 \, \sqrt {a + b}} - \frac {\log \left ({\left | -\sqrt {a + b} e^{\left (2 \, x\right )} + \sqrt {a e^{\left (4 \, x\right )} + b e^{\left (4 \, x\right )} + 2 \, a e^{\left (2 \, x\right )} - 2 \, b e^{\left (2 \, x\right )} + a + b} + \sqrt {a + b} \right |}\right )}{2 \, \sqrt {a + b}} + \frac {\log \left ({\left | -\sqrt {a + b} e^{\left (2 \, x\right )} + \sqrt {a e^{\left (4 \, x\right )} + b e^{\left (4 \, x\right )} + 2 \, a e^{\left (2 \, x\right )} - 2 \, b e^{\left (2 \, x\right )} + a + b} - \sqrt {a + b} \right |}\right )}{2 \, \sqrt {a + b}} \]
-2*arctan(-1/2*(sqrt(a + b)*e^(2*x) - sqrt(a*e^(4*x) + b*e^(4*x) + 2*a*e^( 2*x) - 2*b*e^(2*x) + a + b) + sqrt(a + b))/sqrt(-b))/sqrt(-b) - 1/2*log(ab s(-(sqrt(a + b)*e^(2*x) - sqrt(a*e^(4*x) + b*e^(4*x) + 2*a*e^(2*x) - 2*b*e ^(2*x) + a + b))*(a + b) - sqrt(a + b)*(a - b)))/sqrt(a + b) - 1/2*log(abs (-sqrt(a + b)*e^(2*x) + sqrt(a*e^(4*x) + b*e^(4*x) + 2*a*e^(2*x) - 2*b*e^( 2*x) + a + b) + sqrt(a + b)))/sqrt(a + b) + 1/2*log(abs(-sqrt(a + b)*e^(2* x) + sqrt(a*e^(4*x) + b*e^(4*x) + 2*a*e^(2*x) - 2*b*e^(2*x) + a + b) - sqr t(a + b)))/sqrt(a + b)
Timed out. \[ \int \frac {\tanh ^2(x)}{\sqrt {a+b \tanh ^2(x)}} \, dx=\int \frac {{\mathrm {tanh}\left (x\right )}^2}{\sqrt {b\,{\mathrm {tanh}\left (x\right )}^2+a}} \,d x \]